Repository navigation
The assistant answers how-to questions for the person asking and searches the namespace and the docs together - #509
Merged
Merged
Conversation
…ches the namespace and the docs together The bridge ends each question it sends LibreChat with one line in fixed words: the kind of credential the caller asks with, the role the gate gives it in the namespace, and the kind of namespace. The agent's instructions read it as context for how-to answers only, start a question that does not plainly ask how to use Loom with a memory, a document and a help search together, and cite each docs section as [help:]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
… an answer is admitted; the instructions ask for the role only when the answer needs it Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…; the asker test fakes only the reads it needs Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
zlareb1
force-pushed
the
feat/assistant-help-asker
branch
from
November 10, 2026 22:00
8853361 to
9783489
Compare
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
This was referenced Nov 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #488
Related: #498
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The assistant answers "how do I…" for the person asking: it knows the kind of credential they ask with and the role it has in the namespace, and answers how that role is raised from Loom's documentation. A question that does not plainly ask how to use Loom is searched in the namespace's memories and documents and in the docs together, so a fact the namespace holds is answered from the namespace.
Why
#488 and #498 gave the assistant Loom's documentation and checked
[help:]citations. Two gaps remained.vieweron one namespace, so the agent could not tell what the person may do. "Can I write here? How would I get that?" got a generic answer.claude-haiku-4-5, the agent:Design (
docs/architecture/assistant.md, "The asker's context" and "The agent definition"):open_answer, once an answer is admitted (after the rate limits and the cost checks, so a refused request pays for nothing), works out one line in fixed words from the caller's own credential. The bridge adds it as the last line of the question it sends:Loom, for how-to answers only: this question comes with <credential>, whose role in this <place> is <role>.ns_roles), else a token.CachedGate, the cached grant maps the listings use) after the viewer check every answer passes, else viewer. It isunknownwhen a check is refused because a read it needed failed, and also when any other exception occurs, so the line never refuses an answer.directory().is_restricted_cached, which does no read; anything else is a namespace.grants.list.namespace.list_minecall returns every namespace of the asker's in the org, which widens one answer's reach.memory_search,knowledge_searchandhelp_searchtogether. A fact the namespace holds is answered from the namespace, even when Loom has a setting of the same kind.help_search, and is answered only from what the docs say.help_getbefore answering from it, at most two sections per answer.[help:]only for pages the help tools returned.Scope and risk
server/assistant/app/bridge.py:asker_line,_credential,_gate_role,_place,_with_asker,Ticket.asker.open_answerbuilds the line once an answer is admitted, andstreamappends it, for the chat route andassistant.askalike.integrations/librechat/agent.yaml: the instructions and the version bump.docs/architecture/assistant.md: the asker's context and the agent definition.sa:token with no grant there also reads its service-account row once, and a claim capped at a revoked grant has the gate read the inheriting creator's grant itself; both happen only after admission. A refused request makes none. A how-to answer averages about $0.05 at list price onclaude-haiku-4-5.Compatibility, rollout and rollback
Tests
tests/unit/test_assistant_asker.py:unknownon an unverified refusal or a failing check;tests/unit/test_assistant_bridge.py: the chat route andassistant.asksend the question with the line last.tests/unit/test_assistant_service.py: the definition digest is pinned to version 7.make format,make lintandmake typecheck, and the assistant, doc-link, public-copy and LibreChat unit tests (601 passed).claude-haiku-4-5. The per-use-case table is in the coverage PR that follows.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. The design went through six adversarial architecture reviews to zero findings, and the instruction changes were measured on the qualification harness.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code